Linux系统下查看系统时间和硬件时间

Linux系统下查看系统时间和硬件时间
1.具体命令使用如下:
查看当前系统时间
[root@littlelawson hbase-1.4.0]# date
Mon Jun 18 10:36:45 PDT 2018

设置系统时间
[root@littlelawson hbase-1.4.0]# date -s 21:48:00
Mon Jun 18 21:48:00 PDT 2018

查看当前硬件时间
[root@littlelawson hbase-1.4.0]# hwclock
Mon 18 Jun 2018 09:51:01 PM PDT -0.969901 seconds

设置硬件时间,‘月/日/年 时分’
[root@littlelawson hbase-1.4.0]# hwclock --set --date=‘06/18/18 21:50’

[root@littlelawson hbase-1.4.0]# hwclock --systohc

[root@littlelawson hbase-1.4.0]# hwclock
daMon 18 Jun 2018 09:52:23 PM PDT -0.391427 seconds

[root@littlelawson hbase-1.4.0]# date
Mon Jun 18 21:52:23 PDT 2018
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2.关于hwclock[hardware clock]命令
-s, --hctosys
Set the System Time from the Hardware Clock.#以硬件时间为标准,设置系统时间
Also set the kernel’s timezone value to the local timezone as
indicated by the TZ environment variable and/or
/usr/share/zoneinfo, as tzset(3) would interpret them. The
obsolete tz_dsttime field of the kernel’s timezone value is
set to DST_NONE. (For details on what this field used to
mean, see settimeofday(2).)

          This  is  a  good  option to use in one of the system startup
          scripts.

   -w, --systohc
          Set the Hardware Clock to the current System Time.##以系统时间为标准,设置硬件时间
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值